<HTML>
<HEAD>
<TITLE ID='L_ExprBldr_DialogTitle'>Expression Builder</TITLE>
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=windows-1252'>
<LINK REL="stylesheet" TYPE="text/css" HREF="/widgets/bizdesk.css">

<SCRIPT LANGUAGE="VBScript">
OPTION EXPLICIT

CONST L_ExprBldr_ErrorMessage = "Expression Builder encountered an error."

DIM m_strMode
DIM m_nExprID


SUB docLoadHandler()
  ' Prepare the Expression Builder's config values before attaching the HTC.
  DIM elXML
  DIM objDict
  SET objDict = window.dialogArguments

  m_strMode = objDict.item("Mode")
  m_nExprID = objDict.item("ExprID")

  SET elXML = document.createElement("XML")
    document.body.insertAdjacentElement "beforeEnd", elXML
    elXML.id = "xmlisConfig"
    elXML.loadXML(objDict.item("XMLConfig").xml)

  ' Attach the Expression Builder HTC to let it start initializing.
  divExprBldr.addBehavior("/widgets/exprbldrhtc/ExprBldr.htc")
END SUB


SUB onExprBldrReady()
  ' The Expression Builder is ready to party, so activate it.
  CALL divExprBldr.Activate(m_strMode, m_nExprID)
END SUB


SUB onExprBldrError()
  CALL alert(L_ExprBldr_ErrorMessage)
  CALL window.close()
END SUB


SUB onExprBldrComplete()
  ' Return the Expression Builder's results to the dialog-invoker.
  SET window.returnValue = divExprBldr.GetResults()
  CALL window.close()
END SUB

</SCRIPT>


</HEAD>
<BODY CLASS="clsExprBldr" onload="docLoadHandler()"
  STYLE="margin-top:10px; margin-left:16px; padding:0px; border:none">

<DIV ID="divExprBldr" XMLCfgID="xmlisConfig" onReady="onExprBldrReady()"
  onError="onExprBldrError()" onComplete="onExprBldrComplete()" >
</DIV>

</BODY>
</HTML>
